﻿using System.Collections.Generic;
using System.Linq;

namespace DocuGenerator.Model
{
	public class DeclaringType
	{
		public DeclaringType(
			string name,
			bool canLinkTo,
			string summary = null,
			IEnumerable<Property> properties = null,
			IEnumerable<Method> ctors = null,
			IEnumerable<Method> methods = null)
		{
			Name = name;
			CanLinkTo = canLinkTo;
			Summary = summary;
			Properties = (properties ?? Enumerable.Empty<Property>()).ToArray();
			Methods = (methods ?? Enumerable.Empty<Method>()).ToArray();
			Ctors = (ctors ?? Enumerable.Empty<Method>()).ToArray();
		}

		public string Name { get; private set; }
		public bool CanLinkTo { get; private set; }
		public string Summary { get; private set; }
		public Property[] Properties { get; private set; }
		public Method[] Methods { get; private set; }
		public Method[] Ctors { get; private set; }
	}
}